<template>
  <div id="app">
    <router-view></router-view>
    <DarkMode></DarkMode>
  </div>
</template>

<script>

import DarkMode from "./components/darkmode";
export default {
  name: 'App',
  components: {DarkMode},
  data() {
    return {}
  },
  mounted() {
    this.$bus.$on('logout', this.logout)
    this.$bus.$on('setFinishUpdate', this.setFinishUpdate)
    this.$store.dispatch('checkToken')
    this.$store.dispatch('initSubjects')
  },
  methods: {
    logout() {
      localStorage.removeItem('token')
      localStorage.removeItem('username')
      this.$router.push('/login')
    },
    setFinishUpdate(val) {
      this.$store.dispatch('setFinishUpdate', val)
    }
  }
}
</script>

<style>
* {
  margin: 0;
  font-family: '微软雅黑', sans-serif;
}

#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

.fontColor {
  font-family: '微软雅黑', serif;
  background: linear-gradient(to bottom, #ff438b, rgb(249, 165, 47));
  -webkit-background-clip: text;
  color: transparent;
}

.table {
  margin: 0 auto;
}

.el-popover {
  width: 180px;
  right: 20px;
  top: 25px !important
}
</style>
